<template>
	<view class="activity">
		<view class="item flex" @click="details(item.id)" v-for="(item, index) in list" :key="item.id">
			<divimg class="img" :src="item.image" mode="aspectFill"></divimg>
			<view class="content">
				<view class="title">
					{{ item.title }}
				</view>
				<view class="subtitle">
					{{ item.create_time }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'activity',
		props: {
			list: {
				type: Array,
				default: () => [],
			},
		},
		data() {
			return {};
		},
		methods: {
			details(id) {
				uni.navigateTo({
					url: '/pages/activity/detail/detail?id=' + id,
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.activity {
		width: 100%;
		overflow: hidden;
		padding: $margin-width 0;
		.item {
			margin: 0 auto $submargin-width;
			width: 690rpx;
			height: 250rpx;
			background: #ffffff;
			border-radius: 20rpx 20rpx 20rpx 20rpx;
			.img {
				width: 330rpx;
				height: 250rpx;
				border-radius: 20rpx 20rpx 20rpx 20rpx;
			}
			.content {
				margin-top: $margin-width;
				margin-left: $margin-width;
				width: 300rpx;
				.title {
					font-size: $uni-font-size-12;
					color: #000000;
					line-height: 40rpx;
				}
				.subtitle {
					font-size: $uni-font-size-12;
					color: #999999;
				}
			}
		}
	}
</style>
